:root {
  font-size: 16px;
  --primary-color: #ff434f;
  --secondary-color: #e3e3e3;
  --text-color-lightest: #e7e9ec;
  --text-color-darker: #2e2e2e;
  --text-color-dark: #494949;
  --text-color-gray: #8b8b8b;
  --text-color-dark-gray: #727272;
  --text-color-light-gray: #c6c6c6;
  --backdrop-color: rgba(42, 42, 42, 0.69);
  --percentage: 0%;
}

header {
  width: 100vw;
  height: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2.5rem;
  position: relative;
  z-index: 200;
  .logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color-lightest);
    cursor: pointer;
  }
  nav {
    a {
      color: var(--text-color-lightest);
      margin: 0 1.5rem;
    }
  }
  &.sticky {
    position: fixed;
    background-color: #fff;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.2);
    animation: dropDown 0.5s ease-in-out forwards;
    .logo,
    nav a,
    nav i {
      color: var(--text-color-darker);
    }
  }
  .burger {
    display: none;
  }
}
@keyframes dropDown {
  from {
    transform: translateY(-100px);
  }
  to {
    transform: translateY(0);
  }
}
// 顶部轮播区域
@keyframes swift-up {
  to {
    top: 0rem;
  }
}
@keyframes fade-in {
  to {
    opacity: 1;
  }
}
.slide-container {
  position: relative;
  top: -3rem;
  z-index: 50;
  width: 100vw;
  height: 100vh;
  color: var(--text-color-lightest);
  .text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 70;
    text-align: center;
    h1 {
      width: 70vw;
      span {
        display: inline-block;
        position: relative;
        overflow: hidden;
        top: 0.8rem;
        animation: 0.3s swift-up ease-in-out forwards;
        i {
          position: relative;
          font-size: 3rem;
          font-weight: 600;
          top: 6rem;
          animation: 0.5s swift-up ease-in-out forwards;
        }
      }
      span:nth-of-type(1) i {
        animation-delay: 0s;
      }
      span:nth-of-type(2) i {
        animation-delay: 0.2s;
      }
      span:nth-of-type(3) i {
        animation-delay: 0.4s;
      }
      span:nth-of-type(4) i {
        animation-delay: 0.5s;
      }
      span:nth-of-type(1) {
        animation-delay: 0s;
      }
      span:nth-of-type(2) {
        animation-delay: 0.2s;
      }
      span:nth-of-type(3) {
        animation-delay: 0.4s;
      }
      span:nth-of-type(4) {
        animation-delay: 0.5s;
      }
    }
    p {
      font-size: 2rem;
      margin: 2rem 0;
      position: relative;
      top: 1rem;
      opacity: 0;
      animation: 0.5s swift-up ease-in-out forwards,
        0.5s fade-in ease-out forwards;
      animation-delay: 0.8s;
    }
  }
  .text-scroll {
    h2 {
      position: absolute;
      z-index: 600;
      top: 50%;
      transform: translateY(-50%);
      left: 10%;
      font-size: 2.3rem;
      line-height: 3rem;
    }
    .mask {
      height: 3rem;
      position: relative;
      overflow: hidden;
      width: 100%;
      span {
        font-size: 2rem;
        position: absolute;
        top: 3rem;
        letter-spacing: 2px;
      }
      span[data-show] {
        transform: translateY(-100%);
        transition: 0.5s transform;
      }
      span[data-up] {
        transform: translateY(-200%);
        transition: 0.5s transform ease-in-out;
      }
      span:nth-child(1) {
        color: rgb(56, 233, 109);
      }
      span:nth-child(2) {
        color: rgb(193, 248, 41);
      }
      span:nth-child(3) {
        color: #84c6da;
      }
    }
  }

  .backdrop {
    background: var(--backdrop-color);
    z-index: 60;
    position: absolute;
    width: 100vw;
    height: 100vh;
    left: 0;
    top: 0;
    opacity: 0.5;
  }
}
.slide-container .my-slide img,
.slide-container .my-slide video {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
}

// 内容区域 通用样式
.content-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
section {
  max-width: 1200px;
  padding: 0 5rem;
  margin: 0 auto;
  h2.title {
    text-align: center;
    font-size: 2rem;
    margin: 2rem 0;
    color: var(--text-color-darker);
    letter-spacing: 0.185rem;
  }
}
//关于我
#about-me {
  margin: 0 auto;
  .title {
    text-align: center;
    h2 {
      font-size: 2rem;
      margin-bottom: 2rem;
      background-image: linear-gradient(
        75deg,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 1) 33.33%,
        rgba(0, 0, 0, 0) 66.67%,
        rgba(0, 0, 0, 0) 100%
      );
      background-size: 300% 100%;
      background-position-x: calc(100% - var(--percentage));
      background-clip: text;
      -webkit-background-clip: text;
      color: transparent;
    }
  }
  .content {
    padding: 0.5rem 2.5rem;
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    .photo {
      min-width: 25rem;
      overflow: hidden;
      margin-right: 2rem;
      img {
        height: 100%;
        object-fit: cover;
        object-position: center;
      }
    }
    .description {
      min-width: 15rem;
      font-size: 1.5rem;
      letter-spacing: 1px;
      p {
        overflow: hidden;
        text-indent: 2em;
      }
      a {
        color: var(--text-color-dark);
        i {
          position: absolute;
          bottom: 1rem;
          right: 1rem;
          font-size: 1.4rem;
        }
      }
    }
  }
  .content::after {
    content: "";
    display: block;
    clear: both;
  }
}

//Demo
#demo {
  margin: 2rem 0;
  .demo-container {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
  }
  .demo-item {
    margin: 0.5rem 0.8rem;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.2);
    text-align: center;
    padding-bottom: 1rem;
    transition: 0.4s;
    a {
      display: block;
      width: 100%;
      height: 100%;
    }
    h4.name {
      font-size: 1.5rem;
      color: var(--text-color-darker);
      margin: 0.5rem 0;
    }
    ul {
      font-size: 1.3rem;
      text-align: left;
      display: inline-block;
      vertical-align: middle;
      li {
        margin: 0.4rem 0;
        font-size: 1.2rem;
        span {
          margin-left: 0.5rem;
          color: var(--text-color-dark);
        }
      }
    }
  }
  .demo-item:hover {
    transform: translateY(-0.5rem) scale(1.04);
    box-shadow: 0 0 1.2rem rgba(0, 0, 0, 0.1);
  }
  .profile-img {
    overflow: hidden;
  }
  .profile-img img {
    width: 25vw;
    max-width: 19rem;
    min-width: 15rem;
    height: 12rem;
    object-fit: cover;
  }
}
//文章列表
#article-list {
  .items {
    ul {
      --progress: 1;
      li {
        margin: 1rem auto;
        max-width: 50rem;
        height: 13rem;
        background-color: #fff;
        border-radius: 1rem;
        box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1);
        transform: scale(calc(1.8 - (0.8 * var(--progress))));
        opacity: var(--progress);
        img {
          height: 50%;
          width: 100%;
          object-fit: cover;
          position: relative;
        }
        .backdrop {
          height: 50%;
          width: 100%;
          background: var(--backdrop-color);
          z-index: 60;
          position: absolute;
          top: 0;
          left: 0;
          opacity: 0.5;
        }
        .text {
          padding: 0rem 2rem;
          font-size: 1rem;
          color: var(--text-color-dark-gray);
          .article-title {
            font-size: 1.7rem;
            color: #fff;
            //height: 4rem;
            overflow: hidden;
            position: absolute;
            bottom: 51%;
            z-index: 70;
          }
          .article-introduction {
            margin-top: 0.5rem;
            height: 2.7rem;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
          }
          .line {
            width: 100%;
            border-top: 1px solid rgba(222, 229, 231, 0.45);
            margin: 0.8rem 0;
          }
          .article-inf {
            width: 100%;
            i {
              margin: 0 0.5rem;
              line-height: 1rem;
              span {
                padding: 0 0.25rem;
              }
            }
            i:nth-child(-n + 3) {
              float: left;
            }
            i:nth-child(n + 4) {
              float: right;
            }
          }
          .article-inf::after {
            content: "";
            display: block;
            clear: both;
          }
        }
      }
    }
  }
  //文章列表卡片区域结束
}
//文章详情页
#article {
  overflow: hidden;
  .content-wrapper {
    margin: 3rem auto;
    width: 100vw;
    max-width: 50rem;
    .body {
      padding: 0 0.7rem;
      width: 100vw;
      max-width: 50rem;
    }
    .body .img-container {
      text-align: center;
    }
    .body .lazyImg {
      height: 50px;
      width: 50px;
      object-fit: cover;
      text-align: center;
    }
    .body img {
      max-width: 95%;
      object-fit: cover;
    }
    .cover-image {
      width: 100%;
    }
    .cover-image img {
      max-height: 20vh;
      object-fit: cover;
    }
    .title {
      width: 100%;
      color: var(--text-color-darker);
      font-size: 1.8rem;
      font-weight: 900;
      letter-spacing: 1px;
      margin: 1rem 0;
    }

    .comment {
      width: 100%;
      margin: 1.5rem 0;
      padding: 1rem 2rem;
      border: 1px solid #ebebeb;
      border-radius: 5px;
      box-shadow: 0 1px 3px rgb(18, 18, 18, 0.1);
      .top-bar {
        height: 1.5em;
        line-height: 1.2rem;
        font-size: 1.1rem;
      }
      .line {
        border-bottom: 1px solid #f8f2f2;
        margin-top: 1rem;
      }
      //头像上传及访客昵称
      .top-bar {
        height: 4rem;
        display: flex;
        align-items: center;
        > div {
          margin: 0 1rem;
        }
        .avatar-upload {
          width: 4rem;
          height: 100%;
          border-radius: 0.5rem;
          position: relative;
          cursor: pointer;
          input {
            width: 100%;
            height: 100%;
            opacity: 0;
            position: absolute;
          }
          img {
            width: 100%;
            object-fit: cover;
          }
        }
        .visitor-name {
          flex: 1;
        }
        .email {
          flex: 1;
        }
        input {
          width: 100%;
          height: 2rem;
          font-size: 1.2rem;
          letter-spacing: 2px;
        }
      }

      //评论输入框部分
      .comment-input::after {
        content: "";
        display: block;
        clear: both;
      }
      .comment-input {
        width: 100%;
        margin: 1rem 0;
        border-radius: 4px;
        cursor: text;
        .divText {
          float: left;
          width: 85%;
          min-height: 2rem;
          padding-left: 0.5rem;
          border: 1px solid #ebebeb;
          font-size: 0.9rem;
          font-size: 1.2rem;
          //line-height: 2rem;
          outline: none;
          max-height: 30rem;
          overflow: auto;
        }
        .divText:empty::before {
          content: "写下你的评论...";
          color: #999;
        }
        .divText:focus::before {
          content: none;
        }
        button {
          float: right;
          height: 2rem;
          width: 4rem;
          margin-right: 1rem;
          font-size: 0.9rem;
          color: #fff;
          background-color: #06f;
          border: 1px solid #06f;
          padding: 0.4rem 1rem;
          border-radius: 5px;
          cursor: pointer;
        }
      }
      //评论列表部分
      .commentsList {
        border: 1px solid #ebebeb;
        margin-top: 1rem;
        margin-bottom: 3rem;
        .comment-item {
          border-bottom: 1px solid #ebebeb;
          padding: 1rem 0;
          .comment-item-info {
            height: 2rem;

            .comment-avatar {
              float: left;
              width: 2rem;
              height: 2rem;
              margin: 0 1rem;
              img {
                width: 100%;
                height: 100%;
                object-fit: cover;
              }
            }
            .comment-visitorname {
              float: left;
              line-height: 2rem;
              letter-spacing: 1px;
              font-size: 1.1rem;
            }
            .comment-date {
              float: right;
              line-height: 2rem;
              font-size: 0.9rem;
              color: var(--text-color-dark-gray);
              padding: 0 1rem;
            }
          }
          .comment-content {
            padding: 0.3rem 1rem 0 4rem;
            color: rgb(18, 18, 18);
          }
        }
      }
      .nocomment {
        text-align: center;
        font-size: 1.2rem;
        height: 5rem;
        line-height: 5rem;
        color: var(--text-color-dark-gray);
      }
    }
  }
  //文章详情页面底部点赞部分
  .bottom.isfix {
    display: flex;
    align-items: center;
    max-width: 50rem;
    width: 100%;
    z-index: 2;
    background-color: #fff;
    height: 2.8rem;
    position: fixed;
    bottom: 0;
    padding: 0.2rem 0.4rem;
    box-shadow: 0 -1px 3px rgba(18, 18, 18, 0.1);
    > div {
      margin: 0 1rem;
    }
    span {
      margin-left: 0.5rem;
    }
    i {
      color: var(--text-color-dark-gray);
    }
    .vote {
      background-color: rgba(0, 102, 255, 0.1);
      padding: 0.2rem 0.8rem;
      border-radius: 3px;
      i {
        color: #06e;
      }
      &.vote-up {
        background-color: #06e;
        padding: 0.3rem 0.9rem;
        i {
          color: #fff;
        }
      }
    }
    div:nth-child(-n + 3) {
      cursor: pointer;
    }
    .share canvas {
      position: absolute;
      width: 5rem;
      height: 5rem;
      bottom: 110%;
      left: 35%;
      display: none;
    }
    .share:hover {
      canvas {
        display: block;
        box-shadow: 0 0 2.25rem rgba(0, 0, 0, 0.1);
      }
    }
  }
}
//底部信息
footer {
  background-color: rgb(242, 242, 242);
  padding: 1rem 0 0.2rem 0;
  .footer-menus {
    margin: 0 auto;
    max-width: 1200px;
    width: 100%;
    display: flex;
    padding: 0 5rem;
    position: relative;
    color: rgb(89, 87, 87);
    font-size: 1.5rem;
    justify-content: space-between;
    flex-wrap: wrap;
    > div {
      margin: 1rem;
    }
    .menu-title {
      font-size: 1.2rem;
      margin-bottom: 0.3rem;
    }
    .contact-info {
      position: relative;
      .icon-weixin::after {
        cursor: pointer;
        content: "";
        display: block;
        width: 8rem;
        height: 8rem;
        background: url(../images/Wechat.jpeg) no-repeat;
        background-size: cover;
        position: absolute;
        top: 3rem;
        left: 6rem;
        opacity: 0;
        display: contents;
        transition: transform 0.3s;
        box-shadow: 0 0 2.25rem rgba(0, 0, 0, 0.1);
      }
      .icon-weixin:hover::after {
        display: block;
        transform: translate(1rem, -1rem) scale(1.02);
        opacity: 1;
      }
    }
    li {
      padding: 0.4rem 0;
      height: 2.5rem;
      line-height: 2.5rem;
      i {
        font-size: 1.1rem;
        a {
          padding: 0 0.5rem;
          color: rgb(89, 87, 87);
          cursor: pointer;
        }
      }
      i.juejin {
        img {
          width: 1.2rem;
          height: 1.2rem;
          object-fit: cover;
        }
      }

      span {
        padding: 0 0.5rem;
      }
    }
    .echarts {
      .menu-title {
        text-align: center;
      }
    }
    .qrcode-menu {
      display: flex;
      flex-direction: column;
      .qrcode {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        img {
          width: 7rem;
          height: 7rem;
        }
      }
    }
  }
  .icp-info {
    margin-top: 0.5rem;
    text-align: center;
    span {
      margin: 0 0.5rem;
      color: rgb(102, 102, 102);
      font-size: 0.9rem;
      letter-spacing: 0.5px;
      a {
        color: rgb(102, 102, 102);
        cursor: pointer;
        text-decoration: none;
      }
    }
  }
}
//992断点
@media (max-width: 992px) {
  :root {
    font-size: 15px;
  }
}
//768断点
@media (max-width: 768px) {
  :root {
    font-size: 14px;
  }
  .slide-container {
    .text {
      h1 {
        span {
          display: inline-block;
          position: relative;
          overflow: hidden;
          top: 0.8rem;
          animation: 0.3s swift-up ease-in-out forwards;
          i {
            position: relative;
            font-size: 2.5rem;
            font-weight: 500;
            top: 6rem;
          }
        }
      }
      p {
        font-size: 1.8rem;
      }
    }
  }

  section {
    padding: 0 2rem;
  }
  #demo {
    .demo-container {
      flex-wrap: wrap;
      .demo-item {
        margin: 1rem 1rem;
        .profile-img img {
          width: 40vw;
          height: 15rem;
          object-fit: cover;
        }
      }
    }
  }
  #about-me {
    .title {
      padding: 0 0.5rem;
      h2 {
        font-size: 1.8rem;
      }
    }
    .content {
      display: flex;
      flex-wrap: wrap;
      .photo {
        margin: 0 auto;
        padding: 0 4rem;
        max-height: 30rem;
      }
      .description {
        margin-top: 1rem;
      }
    }
  }
  //头部菜单栏
  header {
    nav {
      display: none;
    }
    .burger {
      display: block;
      width: 20px;
      height: 6px;
      position: relative;
      justify-self: end;
      cursor: pointer;

      div:nth-child(-n + 3) {
        width: 20px;
        height: 2px;
        background-color: var(--text-color-lightest);
      }
      div:nth-child(1) {
        position: absolute;
        top: -6px;
      }
      div:nth-child(3) {
        position: absolute;
        top: 6px;
      }
    }
    &.sticky {
      .burger div:nth-child(-n + 3) {
        background-color: var(--text-color-darker);
      }
    }
    &.open {
      .logo {
        color: var(--text-color-darker);
        z-index: 20;
      }
      nav {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        background-color: #fff;
        position: absolute;
        left: 0;
        top: 0;
        width: 100vw;
        opacity: 0;
        animation: slideDown 0.4s ease-out forwards;
      }
      nav > * {
        color: var(--text-color-darker);
        animation: showMenu 0.5s linear forwards 0.4s;
        font-size: 18px;
        margin: 4px 0;
        opacity: 0;
      }
      .burger {
        div:nth-child(-n + 3) {
          background-color: var(--text-color-darker);
          transition: 0.4s ease;
        }
        div:nth-child(1) {
          transform: rotate(45deg) translate(3px, 5px);
        }
        div:nth-child(2) {
          transform: translateX(5px);
          opacity: 0;
        }
        div:nth-child(3) {
          transform: rotate(-45deg) translate(3px, -5px);
        }
      }
    }
  }
  @keyframes slideDown {
    from {
      height: 0;
      opacity: 0;
    }
    to {
      padding: 4rem 3rem;
      opacity: 1;
    }
  }
  @keyframes showMenu {
    from {
      opacity: 0;
      transform: translateY(-1);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  //文章详情页
  #article {
    //文章详情页面底部点赞部分
    .bottom.isfix {
      > div {
        margin: 0 0.4rem;
      }
      span {
        margin-left: 0.3rem;
        font-size: 1.1rem;
      }
    }
  }
}
//576断点
@media (max-width: 576px) {
  :root {
    font-size: 12px;
  }

  section {
    padding: 0;
  }
  #demo {
    .demo-container {
      flex-direction: column;
      .demo-item {
        margin: 1rem 0;
        .profile-img img {
          max-width: none;
          width: 60vw;
          height: 15rem;
          object-fit: cover;
        }
      }
    }
  }
  #article-list {
    .items ul li {
      margin: 1rem 0;
      height: 18rem;
      border-radius: 0rem;
      min-width: 350px;
      .article-inf i {
        font-size: 1rem;
        margin: 0 0.3rem;
        line-height: 1rem;
      }
      .article-inf i span {
        padding: 0 0.3rem;
      }
      .text {
        padding: 0rem 0.5rem;
      }
    }
  }
  //文章详情页
  #article {
    width: 100vw;
    .content-wrapper {
      width: 100vw;
      max-width: 100vw;
      .comment {
        min-width: 350px;
        .top-bar {
          height: 4rem;
        }
        .comment-input {
          .divText {
            width: 80%;
          }
          button {
            margin-right: 1rem;
            font-size: 1.1rem;
            padding: 0.1rem 0.4rem;
          }
        }
      }
    }
    //文章详情页面底部点赞部分
    .bottom.isfix {
      display: flex;
      min-width: 350px;
      justify-content: space-around;
      align-items: center;
      .time {
        display: none;
      }
      > div {
        i {
          span {
            font-size: 1.4rem;
          }
        }
      }
    }
  }
}
